﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using System.Data.OleDb;
using DataAccess;

namespace UI
{
    public partial class frmCasingPre : DevExpress.XtraEditors.XtraForm
    {
        private DataTable dispDt;
        private DataTable initDt;
        //从数据库中读取的表格
        private DataTable dispDt2;
        private DataTable initDt2;
        public frmCasingPre()
        {
            InitializeComponent();
            initDtcontent();
            gridControl3.DataSource = dispDt;
            initDt2content2();
            gridControl4.DataSource = dispDt2;
        }       

        private void initDtcontent()
        {
            ////获取Access数据表中的数据
            //initDt =AccessHelper.commSearch("well_parameter");
            //initDt.Columns[1].ColumnName = "井深(m)";
            //initDt.Columns[2].ColumnName = "钻压(kN)";
            //initDt.Columns[3].ColumnName = "转速(r/min)";
            //initDt.Columns[4].ColumnName = "机械钻速(m/h)";

            ////选择部分列信息进行展示
            //dispDt = new DataTable();
            //dispDt.Columns.Add(new DataColumn("井深(m)", typeof(string)));
            //dispDt.Columns.Add(new DataColumn("钻压(kN)", typeof(string)));
            //dispDt.Columns.Add(new DataColumn("转速(r/min)", typeof(string)));
            //dispDt.Columns.Add(new DataColumn("机械钻速(m/h)", typeof(string)));
            //DataRow dr = null;
            //foreach (DataRow row in initDt.Rows)
            //{
            //    dr = dispDt.NewRow();
            //    dr["井深(m)"] = row["井深(m)"];
            //    dr["钻压(kN)"] = row["钻压(kN)"];
            //    dr["转速(r/min)"] = row["转速(r/min)"];
            //    dr["机械钻速(m/h)"] = row["机械钻速(m/h)"];
            //    dispDt.Rows.Add(dr);
            //}
        }
       
        private void initDt2content2()
        {
        //    initDt2 = AccessHelper.commSearch("well_log");
        //    initDt2.Columns[1].ColumnName = "日期";
        //    initDt2.Columns[2].ColumnName = "井深(m)";
        //    initDt2.Columns[3].ColumnName = "日进尺(m)";
        //    initDt2.Columns[4].ColumnName = "钻井方式";

        //    //选择部分列信息进行展示
        //    dispDt2 = new DataTable();
        //    dispDt2.Columns.Add(new DataColumn("日期", typeof(string)));
        //    dispDt2.Columns.Add(new DataColumn("井深(m)", typeof(string)));
        //    dispDt2.Columns.Add(new DataColumn("日进尺(m)", typeof(string)));
        //    dispDt2.Columns.Add(new DataColumn("钻井方式", typeof(string)));
        //    DataRow dr = null;
        //    foreach (DataRow row in initDt2.Rows)
        //    {
        //        dr = dispDt2.NewRow();
        //        dr["日期"] = row["日期"];
        //        dr["井深(m)"] = row["井深(m)"];
        //        dr["日进尺(m)"] = row["日进尺(m)"];
        //        dr["钻井方式"] = row["钻井方式"];
        //        dispDt2.Rows.Add(dr);
        //    }
        }
    }
}